<template>
 <div>
  <HeaderIndex />
  <!-- <AppLayout />路由组件出口的地方 -->
   <router-view></router-view>

   <!-- 在Home、Search显示，在登录、注册页面不显示 -->
   <!-- <FooterIndex v-show="$route.path === '/home' || $route.path === '/search'" /> -->
   <!--路由元信息meta.show控制显示-->
   <FooterIndex v-show="$route.meta.show" />
 </div>
</template>

<script>
import FooterIndex from './layout/footer/FooterIndex.vue';
import HeaderIndex from './layout/header/HeaderIndex.vue';

// import AppLayout from '@/layout/AppLayout.vue';

export default {
  name: 'App',
  components: {
    HeaderIndex,
    FooterIndex
    // AppLayout,
  },
  mounted() {
    //派发一个action||获取商品分类的三级列表数据
    this.$store.dispatch('setCategoryList');
  }
}
</script>

<style>
* {
  padding: 0;
  margin: 0;
}
html, body {
  height: 100%;
  width: 100%;
}
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* text-align: center; */
  color: #2c3e50;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  /* margin-top: 60px; */
}
</style>
